package uk.ac.cam.echo.social;

import org.json.JSONException;
import org.json.JSONObject;

public class FacebookResponse
{
	boolean errorOccured;
	String errorText;
	String newObjectId;

	public FacebookResponse(String response) throws JSONException
	{
		JSONObject obj = new JSONObject(response);
		if (obj.has("error"))
		{
			errorOccured = true;
			errorText = obj.getString("error");
			newObjectId = null;
		}
		else
		{
			errorOccured = false;
			errorText = null;
			newObjectId = obj.getString("id");
		}
	}
}
